﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FLEN_Sim.funct
{
    /// <summary>
    /// Enthält Beschreibungen und Methoden für die Städte und deren Nummern.
    /// </summary>
    public static class CityNumbers
    {
        public const short WITTEN = 1;
        public const short HATTINGEN = 2;
        public const short ENNEPETAL = 3;
        public const short SCHWELM = 4;
        public const short GEVELSBERG = 5;
        public const short WETTER = 6;
        public const short SPROCKHÖVEL = 7;
        public const short HERDECKE = 8;
        public const short BRECKERFELD = 9;

        public const string EINS = "Witten";
        public const string ZWEI = "Hattingen";
        public const string DREI = "Ennepetal";
        public const string VIER = "Schwelm";
        public const string FÜNF = "Gevelsberg";
        public const string SECHS = "Wetter";
        public const string SIEBEN = "Sprockhövel";
        public const string ACHT = "Herdecke";
        public const string NEUN = "Breckerfeld";

        private static readonly string[] cityNames = {null, "Witten", "Hattingen", "Ennepetal", "Schwelm", "Gevelsberg", "Wetter", "Sprockhövel", "Herdecke", "Breckerfeld" };

        public static string getCityByNumber(int number)
        {
            if (number < cityNames.Length)
            {
                return cityNames[number];
            }
            else
            {
                return null;
            }
        }

        public static short getCityByName(string name)
        {
            for (short i = 1; i < cityNames.Length; i++)
            {
                if (cityNames[i] == name)
                    return i;
            }

            return -1;
        }
    }
}
